﻿using System.Collections.ObjectModel;
using System.ComponentModel.DataAnnotations;

namespace SmartPlant.Model.DbContext.Biz
{
    public class ReportParameter
    {
        public string Name { get; set; }
        public string Value { get; set; }

        ///如 = != > like
        public string Operator { get; set; } = "=";
    }

    public class Report
    {
        public Report()
        {

        }
        #region 1
        public bool IsChecked { get; set; } = false;

        public string InOrOutStr { get; set; }

        public List<ReportParameter> ParametersObj { set; get; } = new List<ReportParameter>();
        public ObservableCollection<string> XMLs { get; set; } = new ObservableCollection<string>();
        #endregion 1
        public Guid ReportId { get; set; }

        /// <summary>
        /// 参数名称，逗号隔开
        /// </summary>
        public string? Parameters { get; set; }

        /// <summary>
        /// 输入或者输出。0是输入，1是输出
        /// </summary>
        [Required]
        public int InOrOut { set; get; }
        /// <summary>
        /// 类型，输入的是枚举的具体字符。 <see cref="TemplateType"/>
        /// </summary>
        [Required]
        public TemplateType Type { set; get; }
        /// <summary>
        /// 名字，也是具体模板文件的名字（如xxx.xlsx或xxx.xml）
        /// </summary>
        [Required(ErrorMessage = "必填")]
        public string Name { get; set; }

        public string Description { get; set; }
        /// <summary>
        /// reportService中的某个方法名
        /// </summary>
        public string GenerateFunc { get; set; }

        public string SQL { get; set; }
        /// <summary>
        /// 模板文件的相对路径（默认为当前的domain名字）。绝对路径就在vaultConfig.path + templates_output。 
        /// </summary>
        public string TemplatePath { get; set; }



    }
}
